namespace Bootsy.Tests.Voting

import NUnit.Framework
import ConcurrentBoo.Executors
import Bootsy.Tests

[TestFixture]
class VotingBotTestFixture:
	
	[Test]
	def Voting():
		chat = DummyChat()
	
		votingBot = Bootsy.Voting.VotingBot(DirectExecutor())
		votingBot.OnMessage(chat.NewMessage("!voting begin"))
		votingBot.OnMessage(chat.NewMessageFromUser("+2", "John"))
		votingBot.OnMessage(chat.NewMessageFromUser("-3", "Robert"))
		votingBot.OnMessage(chat.NewMessageFromUser("0", "Eric"))
		
		Assert.AreEqual(0, chat.Messages.Count)
		votingBot.OnMessage(chat.NewMessage("!voting end"))
		
		Assert.AreEqual(1, chat.Messages.Count)
		Assert.AreEqual("The votes are in and the final count is: -1", chat.Messages[0])
